home *** CD-ROM | disk | FTP | other *** search
- package Local.Game.Thing
- {
- import Local.Game.World.*;
- import Local.Game.World.Map.*;
- import Local.Game.World.Map.Cell.*;
- import Local.Math.*;
- import STC9.System.*;
- import flash.display.*;
- import flash.events.*;
- import flash.geom.*;
-
- public class CVehicleScudLauncher extends CVehicle
- {
-
-
- private var mScudMissile:CThingAnimation;
-
- private var mRaiseCount:Number;
-
- private var mTrackSoundID:String;
-
- private var mTargetPosition:CPosition;
-
- public function CVehicleScudLauncher(param1:CPosition)
- {
- super(param1);
- mType = "scudlauncher";
- Process = Process_Normal;
- mMaxSpeed = 4 * mSpriteScalar;
- mMaxLife = mLife = 100;
- mSpeed = 0;
- mAcceleration = 0.1;
- zDepth -= 10;
- mOrientation = -1;
- SetTargetting(2000 - Math.random() * 500,false,FILTER_GroundTargets,false,800);
- AddAnimation("stand",ScudLauncher,"AddSprite_Black",true);
- SetCollisionBySprite(mAnimation[0]);
- CompileNodes();
- SetState("GOTO");
- AddThing(mScudMissile = new CThingAnimation(ScudMissile,"AddSprite_Black"));
- mScudMissile.mOrientation = mOrientation;
- mScudMissile.zDepth = zDepth;
- IncrementBuild();
- }
-
- public function State_MOUSEOVER_Enter() : void
- {
- }
-
- override public function Dispose() : void
- {
- if(true)
- {
- if(mDisposed)
- {
- if(true)
- {
- return;
- }
- addr30:
- StopSound(mTrackSoundID);
- }
- else
- {
- super.Dispose();
- if(mTrackSoundID != "")
- {
- §§goto(addr30);
- }
- }
- }
- }
-
- public function State_GOTO_Exit() : void
- {
- }
-
- public function State_RAISESCUD() : void
- {
- var _loc1_:Number = NaN;
- _loc1_ = 0.2 * mEnemySpeed;
- §§push(§§findproperty(mRaiseCount));
- §§push(mRaiseCount);
- if(true)
- {
- §§push(§§pop() + _loc1_);
- }
- §§pop().mRaiseCount = §§pop();
- §§push(mScudMissile);
- if(true)
- {
- §§pop().mAngle.mAngleDEG = mScudMissile.mAngle.mAngleDEG + _loc1_;
- §§push(mScudMissile);
- }
- if(§§pop().mAngle.mAngleDEG >= 50)
- {
- SetState("LAUNCHSCUD");
- }
- }
-
- public function State_MOUSEOVER_Exit() : void
- {
- }
-
- public function State_LAUNCHSCUD_Exit() : void
- {
- }
-
- public function State_GOTO() : void
- {
- if((mCurrentTarget = GetTarget()) != null)
- {
- SetState("RAISESCUD");
- return;
- }
- VehicleMove();
- if(mDisposed)
- {
- return;
- }
- §§push(mScudMissile);
- if(true)
- {
- §§pop().mPosition.Copy(OrientatePoint(mSprite.mObjects["scud"].mPosition.clone(),mPosition));
- §§push(mScudMissile);
- }
- §§pop().mAngle.Copy(mAngle);
- mCollide.Update();
- }
-
- public function State_RAISESCUD_Enter() : void
- {
- mRaiseCount = 0;
- AddLoopingSound("raise",Scud_Raise);
- mTrackSoundID = PlaySound("raise");
- mTargetPosition = mCurrentTarget.mPosition;
- }
-
- public function State_RELOADSCUD() : void
- {
- if(true)
- {
- if(mStateCount <= 0)
- {
- SetState("GOTO");
- }
- }
- }
-
- public function State_MOUSEOVER() : void
- {
- if(true)
- {
- §§push(mStateCount < 0);
- if(mStateCount < 0)
- {
- §§pop();
- if(true)
- {
- addr28:
- if(mMouseOver)
- {
- }
- §§goto(addr32);
- }
- SetState(mReturnStateID);
- addr32:
- return;
- }
- }
- §§goto(addr28);
- }
-
- public function State_LAUNCHSCUD_Enter() : void
- {
- StopSound(mTrackSoundID);
- mTrackSoundID = "";
- AddSound("fire",Scud_Fire);
- PlaySound("fire");
- }
-
- public function State_RELOADSCUD_Exit() : void
- {
- mScudMissile.mAngle.Copy(mAngle);
- mScudMissile.mInvisible = false;
- }
-
- public function State_GOTO_Enter() : void
- {
- }
-
- override public function Draw() : void
- {
- var _loc1_:Matrix = null;
- if(true)
- {
- super.Draw();
- }
- _loc1_ = GetOrientationMatrix();
- if(true)
- {
- DrawSprite(_loc1_);
- mScudMissile.Draw();
- }
- }
-
- public function Process_Normal() : void
- {
- if(true)
- {
- if(Process_State != null)
- {
- if(true)
- {
- Process_State();
- if(true)
- {
- addr27:
- Process_Children();
- }
- if(mDead)
- {
- }
- §§goto(addr33);
- }
- DispatchDispose();
- §§goto(addr33);
- }
- §§goto(addr27);
- }
- addr33:
- }
-
- override public function get mPrize() : int
- {
- return CPeepM16.mCost * 50;
- }
-
- public function State_LAUNCHSCUD() : void
- {
- mScudMissile.mInvisible = true;
- AddThing(new CShotScud(mScudMissile.mPosition.Clone(),mScudMissile.mAngle.Clone(),mTargetPosition));
- SetState("RELOADSCUD");
- }
-
- public function State_RELOADSCUD_Enter() : void
- {
- §§push(§§findproperty(mStateCount));
- §§push(SECONDS * 4);
- if(true)
- {
- §§push(§§pop() / mEnemySpeed);
- }
- §§pop().mStateCount = §§pop();
- }
-
- public function State_RAISESCUD_Exit() : void
- {
- }
-
- override public function get mBaseDamage() : Number
- {
- return 500;
- }
- }
- }
-